#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;

class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        for (int cur = 0, des = -1; cur < nums.size(); cur++)
            if (nums[cur])
                swap(nums[cur], nums[++des]);
    }
};
int main()
{
    vector<int> nums = { 0,1,0,3,4,0,12 };
    Solution so;
    so.moveZeroes(nums);
    return 0;
}